package name.huzhenbo.java.threads;

import name.huzhenbo.java.objects.Point;

/**
 * Must internaly synchronize static field, because it's impossible for client to perform external synchronizaiton.
 * <p/>
 * See the Math.random().
 */
class WithMutableStaticField {

    private static Point field;

    public synchronized static Point getField() {
        return field;
    }

    public synchronized static void initField(Point field) {
        if (WithMutableStaticField.field == null) {
            WithMutableStaticField.field = field;
        }
    }
}
